<% content_for :action_nav do %>
<!-- begin action nav -->
<div id="page-nav">
  <ul id="act-nav" class="clear">
    <li><%= link_to _("General"), '#general' %></li>
    <li><%= link_to _("Comments"), '#spam' %></li>
    <li><%= link_to _("Publishing"), '#publish' %></li>
    <% if ActionController::Base.perform_caching -%>
    <li><%= link_to _('Caches'), :controller => '/admin/cached_pages' %></li>
    <% end -%>
  </ul>
</div>
<!-- /end action nav -->
<% end %>


<% form_for :site, :url => { :action => "update" } do |f| %>
<div id="general" class="setgroup">
  <h3><%= _('General site settings') %></h3>
  <dl class="setform">
    <dt><label for="site_title"><%= _('Website title') %></label></dt>
    <dd><%= f.text_field :title %></dd>
    <dt><label for="site_subtitle"><%= _('Website subtitle') %></label></dt>
    <dd><%= f.text_field :subtitle %></dd>
    <dt>
      <label for="site_email"><%= _('Administrator email') %></label>
      <span class="hint"><%= _('Shown in emails sent from your site') %></span>
    </dt>
    <dd><%= f.text_field :email %></dd>
    <dt><label for="site_timezone"><%= _('Website Timezone') %></label></dt>
    <dd><%= select_tag 'site_timezone', options_for_select(['UTC'] + TZInfo::Timezone.all.map{|tz| [tz.to_s, tz.name]}.sort, @site.timezone.name), :name => 'site[timezone]' %></dd>
    <dt>
      <label for="site_current_theme_path"><%= _('Current Theme Path') %></label>
      <span class="hint"><%= _("This is the path to the current template in /themes/site-%{siteid}.  Be careful with this setting!") % {:siteid => site.id} %></span>
    </dt>
    <dd>
      <%= f.text_field :current_theme_path %>
    <% unless site.theme.name == site.current_theme_path -%>
      <strong><%= _('This setting is incorrect, set it to a valid theme path.') %></strong>
    <% end -%>
    </dd>
  </dl>
</div>

<div id="spam" class="setgroup">
  <h3><%= _('Spam prevention') %></h3>
  <p><%= _("At the moment Mephisto uses %{akismet} to automatically handle spam.  If you leave out the Akismet settings, you can moderate new comments from the Overview.") % {:akismet => link_to('Akismet', 'http://akismet.com')} %></p>
  <dl class="setform">
    <dt><label><%= _('Akismet API Key') %></label></dt> 
    <dd><%= f.text_field :akismet_key %></dd>
    <dt><label>Blog url</label></dt> 
    <dd><%= f.text_field :akismet_url %></dd>
    <dt><label for="site_comment_age"><%= _('Comments') %></label></dt>
    <dd><%= f.select :comment_age, comment_expiration_options %></dd>
    <dt>
      <label><%= f.check_box 'approve_comments' %><%= _(' Approve and publish all comments automatically.') %></label>
    </dt>
  </dl>
</div>

<div id="publish" class="setgroup">
  <h3><%= _('Publishing and Reading') %></h3>
  <dl class="setform">
    <dt>
      <label for="comments_filter"><%= _('Comments filter') %></label>
      <p class="hint"><%= _('When comments are posted, they use this markup') %></p>
    </dt>
    <dd>
      <select name="site[filter]">
        <%= options_for_select(filter_options, site.filter) %>
      </select>
    </dd>
    <dt>
      <label for="site_articles_per_page"><%= _('Articles per page') %></label>
      <p class="hint"><%= _('Default article limit for search/tag pages.') %></p>
    </dt>
    <dd><%= f.text_field :articles_per_page, :class => 'tiny' %></dd>
    <dt>
      <label for="site_search_path"><%= _('Search area url') %></label>
    </dt>
    <dd><%= f.text_field :search_path %></dd>
    <% if @layouts.any? -%>
    <dt>
      <label for="site_search_layout"><%= _('Search area layout') %></label>
    </dt>
    <dd>
      <select name="site[search_layout]">
        <%= options_from_templates_for_select(@layouts, @site.search_layout) %>
      </select>
    </dd>
    <% end -%>
    <dt>
      <label for="site_tag_path"><%= _('Tag area url') %></label>
    </dt>
    <dd><%= f.text_field :tag_path %></dd>
    <% if @layouts.any? -%>
    <dt>
      <label for="site_tag_layout"><%= _('Tag area layout') %></label>
    </dt>
    <dd>
      <select name="site[tag_layout]">
        <%= options_from_templates_for_select(@layouts, @site.tag_layout) %>
      </select>
    </dd>
    <% end -%>
    <dt>
      <label for="permalink_style"><%= _('Article url style') %></label>
      <p class="hint">Use the <code>:year</code>, <code>:month</code>, <code>:day</code>, <code>:permalink</code>, and <code>:id</code><% _('in place of actual article values.') %></p>
    </dt>
    <dd><%= f.text_field :permalink_style %></dd>
  </dl>
</div>

<p class="btns"><%= submit_tag _('Save and apply settings') %></p>
<% end %>
    
